package spm.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 * This is a persistent class used by Hibernate. The class represents a user.
 * 
 * @author Evgeny Ryzhkov
 * 
 * $Id: User.java 11 2006-12-04 15:04:58Z evgeny.ryzhkov $
 */
public class User {

	/**
	 * The unique ID of the user.
	 */
	private Long id;

	/**
	 * The user first name.
	 */
	private String firstName;

	/**
	 * The user last name.
	 */
	private String lastName;

	/**
	 * The user middle name.
	 */
	private String middleName;

	/**
	 * The user login.
	 */
	private String loginName;

	/**
	 * The user password.
	 */
	private String loginPassword;

	/**
	 * The date the user was created.
	 */
	private Date createDate;

	/**
	 * The boolean flag showing wether the user is blocked.
	 */
	private boolean blocked;

	/**
	 * The boolean flag showing wether the user is deleted.
	 */
	private boolean deleted;

	/**
	 * The global role assigned to the user.
	 */
	private Role globalRole;

	/**
	 * The tasks assigned to the user.
	 */
	private Set assignedTask = new HashSet();

	/**
	 * Constructor without parameters. It is required by Hibernate.
	 */
	public User() {
	}

	/**
	 * @return Returns the blocked.
	 */
	public boolean isBlocked() {
		return blocked;
	}

	/**
	 * @param blocked
	 *            The blocked to set.
	 */
	public void setBlocked(boolean blocked) {
		this.blocked = blocked;
	}

	/**
	 * @return Returns the createDate.
	 */
	public Date getCreateDate() {
		return createDate;
	}

	/**
	 * @param createDate
	 *            The createDate to set.
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * @return Returns the deleted.
	 */
	public boolean isDeleted() {
		return deleted;
	}

	/**
	 * @param deleted
	 *            The deleted to set.
	 */
	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	/**
	 * @return Returns the firstName.
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param firstName
	 *            The firstName to set.
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return Returns the id.
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            The id to set.
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return Returns the lastName.
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param lastName
	 *            The lastName to set.
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * @return Returns the loginName.
	 */
	public String getLoginName() {
		return loginName;
	}

	/**
	 * @param loginName
	 *            The loginName to set.
	 */
	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	/**
	 * @return Returns the loginPassword.
	 */
	public String getLoginPassword() {
		return loginPassword;
	}

	/**
	 * @param loginPassword
	 *            The loginPassword to set.
	 */
	public void setLoginPassword(String loginPassword) {
		this.loginPassword = loginPassword;
	}

	/**
	 * @return Returns the middleName.
	 */
	public String getMiddleName() {
		return middleName;
	}

	/**
	 * @param middleName
	 *            The middleName to set.
	 */
	public void setMiddleName(String middleName) {
		this.middleName = middleName;
	}

	/**
	 * @return the assignedTask
	 */
	public Set getAssignedTask() {
		return assignedTask;
	}

	/**
	 * @param assignedTask
	 *            the assignedTask to set
	 */
	public void setAssignedTask(Set assignedTask) {
		this.assignedTask = assignedTask;
	}

	/**
	 * @return Returns the globalRole.
	 */
	public Role getGlobalRole() {
		return globalRole;
	}

	/**
	 * @param globalRole
	 *            The globalRole to set.
	 */
	public void setGlobalRole(Role globalRole) {
		this.globalRole = globalRole;
	}

}
